import { Field, Int, ObjectType } from "@nestjs/graphql";
import { BaseEntity } from "./baseEntity";
import { Comment } from "@prisma/client";
import { UserEntity } from "./user.entity";
import { ShopEntity } from "./shop.entity";
import { OrderEntity } from "./order.entity";


@ObjectType()
export class CommentEntity extends BaseEntity implements Comment {
    @Field(() => Int)
    userId: number;

    @Field(() => UserEntity, { nullable: true })
    user: UserEntity

    @Field(() => Int)
    shopId: number;

    @Field(() => ShopEntity, { nullable: true })
    shop: ShopEntity

    @Field()
    context: string;

    @Field(() => Int)
    orderId: number;

    @Field(() => OrderEntity, { nullable: true })
    order: OrderEntity

    @Field()
    hash_key: string

    @Field(() => Int)
    rate: number;
}